import {getUserInfo} from '@/api/api'
import * as types from '../type'
const state = {
  userInfo: {}
}
const getters = {
  userInfo: state => state.userInfo
}
const actions = {
  async getUserInfo ({ commit }, account) {
    const res = await getUserInfo(account)
    commit(types.USERINFO, res.data)
    // return res.data
  }
}
const mutations = {
  [types.USERINFO] (state, rec) {
    state.userInfo = rec
  }
}
export default {
  state,
  getters,
  actions,
  mutations
}
